home *** CD-ROM | disk | FTP | other *** search
/ Varios Español / Varios Español.iso / PMAKER65 / archive.z / LIGADURAS....SPT < prev    next >
Text File  |  1997-01-23  |  7KB  |  188 lines

  1. -- Ligatures
  2. -- 1 October 96, rs
  3.  
  4. -- Este gui≤n a±adirß o eliminarß ligaduras.
  5. -- En Windows debe especificarse en todos los casos una fuente de ligadura.
  6. -- ╔ste puede ser el tipo "experto" de la fuente.
  7. -- Si s≤lo se seleccionan ligaduras fl y fi en Macintosh, 
  8. -- no hace falta introducir ninguna fuente tipogrßfica.
  9. -- En Macintosh, puede introducir "cualquiera" para una fuente s≤lo si 
  10. -- las ligaduras fi o fl estßn seleccionadas.
  11.  
  12. getfont >> origFont
  13. ligFont = origFont
  14.  
  15. getplatform >> platform
  16.  
  17. dialogDataInvalid = 1
  18. getplatform >> platform
  19. while (dialogDataInvalid)
  20. dialogDataInvalid = 0
  21. if platform = MACINTOSH
  22.     dialogbegin -175,-175, 160,  95, "Ligaduras"
  23.     static         5,   5, 210,  25, "A±adir/Eliminar ligaduras"
  24.     static         5,  60, 110,  80, "Nombre de fuente de ligadura"
  25.     edit         120,  60, 315,  80, ligFont
  26.     static         5,  30, 110,  50, "Nombre de fuente"
  27.     edit         120,  30, 315,  50, origFont
  28.     checkbox       5,  90, 160, 110, "fl Ligadura"
  29.     checkbox       5, 115, 160, 135, "fi  Ligadura"
  30.     checkbox       5, 140, 160, 160, "ff  Ligadura"
  31.     checkbox       5, 165, 160, 185, "ffl  Ligadura"
  32.     checkbox       5, 190, 160, 210, "ffi  Ligadura"
  33.     radiobutton    5, 220, 115, 240, "Artφculo actual", 1
  34.     radiobutton  125, 220, 260, 240, "Todos los artφculos del doc."
  35.     pushbutton   185, 245, 245, 265, "Cancelar"
  36.     pushbutton   255, 245, 315, 265, "OK"
  37. else
  38.     dialogbegin -125,-125, 114,  68, "Ligaduras"
  39.     static         4,   4, 100,  18, "A±adir/Eliminar ligaduras    "
  40.     static         4,  40,  70,  60, "Nombre de fuente de ligadura:"
  41.     edit          86,  43, 225,  57, ligFont
  42.     static         4,  21,  75,  36, "Nombre de fuente:  "
  43.     edit          86,  21, 225,  36, origFont
  44.     checkbox       16,  64, 114,  79, "fl  Ligadura"
  45.     checkbox       16,  82, 114,  96, "fi  Ligadura"
  46.     checkbox       16, 100, 114, 114, "ff  Ligadura"
  47.     checkbox       16, 118, 114, 132, "ffl  Ligadura"
  48.     checkbox       16, 136, 114, 150, "ffi  Ligadura"
  49.     radiobutton    16, 157,  72, 171, "Artφculo actual", 1
  50.     radiobutton   90, 157, 186, 171, "Todos los artφculos del doc."
  51.     pushbutton   132, 175, 175, 189, "Cancelar"
  52.     pushbutton   182, 175, 225, 189, "OK"
  53. endif
  54. dialogend => buttonHit, ..., ..., ligFont, ..., origFont, doflLig, dofiLig, doffLig, dofflLig, doffiLig, curStory, ...
  55.  
  56. if (buttonHit = "Cancelar") + empty(buttonHit) 
  57.     return
  58. endif
  59.  
  60. if (origFont = ligFont) // Lig Font not Different
  61.     errorMessage = "Introduzca otro nombre para la fuente de ligadura."
  62.     errorMessage2 = "Si la fuente de ligadura es la misma, elimine datos del campo."
  63. else
  64. getfont >> defaultFont
  65. errorMessage = ""
  66. errorMessage2 = ""
  67. if not(tolower(origFont) = "cualquiera")
  68.   try font origFont
  69.   getlasterror >> fonterr
  70. endif
  71. if fonterr
  72.     errorMessage = "Fuente no encontrada. Compruebe la ortografφa y escrφbala de nuevo."
  73. else
  74.   if (platform = WINDOWS) + doffLig + doffiLig + dofflLig // Lig font needed
  75.     try font ligFont
  76.     getlasterror >> fonterr
  77.     if fonterr
  78.         errorMessage = "Ligadura no encontrada. Compruebe la ortografφa y escrφbala de nuevo."
  79.       if (platform = MACINTOSH)
  80.           errorMessage2 = "TambiΘn puede dejar el espacio en blanco y deseleccionar las opciones ff, ffi y ffl."
  81.       endif // platform
  82.     endif //fonterr
  83.   endif // Lig font needed
  84. endif // Orig font error
  85. endif // Lig Font Not Different
  86. if not(errorMessage = "")
  87.     message errorMessage
  88.     message errorMessage2    
  89.     dialogDataInvalid = 1
  90. endif
  91. endwhile
  92.  
  93. if curStory = 1
  94.     range = currentstory
  95. else
  96.     range = allstories
  97. endif
  98. font defaultFont // Change back to what is was originally set to.
  99.  
  100.  
  101.  
  102. wholeWord = allinstances // not just whole word
  103. case = matchcase
  104. wrap = stopatend
  105.  
  106. try editstory
  107. textcursor -story
  108.  
  109. if not(LigFont = "") // Ligature font has been specified on Mac
  110.  
  111. if doffiLig // *** ffi *******************
  112.     findtypeattr1   origFont, any, any, any, any, any // font, pointSize, leading, typeStyle, position, case
  113.     changetypeattr1 ligFont,  any, any, any, any, any
  114.     try changeall "ffi", "Y",  range, case, wholeWord, useattributes
  115. else
  116.     findtypeattr1   ligFont, any, any, any, any, any 
  117.     changetypeattr1 origFont,  any, any, any, any, any
  118.     try changeall "Y", "ffi", range, case, wholeWord, useattributes
  119. endif
  120.  
  121. if dofflLig // *** ffl *******************
  122.     findtypeattr1   origFont, any, any, any, any, any 
  123.     changetypeattr1 ligFont,  any, any, any, any, any
  124.     try changeall "ffl", "Z", range, case, wholeWord, useattributes
  125. else // TURN OFF LIGATURE
  126.     findtypeattr1   ligFont, any, any, any, any, any 
  127.     changetypeattr1 origFont,  any, any, any, any, any
  128.     try changeall "Z", "ffl", range, case, wholeWord, useattributes
  129. endif
  130.  
  131. if doffLig // *** ff *******************
  132.     findtypeattr1   origFont, any, any, any, any, any 
  133.     changetypeattr1 ligFont,  any, any, any, any, any
  134.     try changeall "ff", "V", range, case, wholeWord, useattributes
  135. else
  136.     findtypeattr1   ligFont, any, any, any, any, any 
  137.     changetypeattr1 origFont,  any, any, any, any, any
  138.     try changeall "V", "ff",  range, case, wholeWord, useattributes
  139. endif
  140.  
  141. if (platform = MACINTOSH) // the ligature is in the same font face for these
  142.   findtypeattr1   origFont, any, any, any, any, any 
  143.   changetypeattr1 origFont, any, any, any, any, any
  144. endif
  145.  
  146. endif // Specified Lig Font
  147.  
  148. if dofiLig // *** fi *******************
  149.     if platform = MACINTOSH
  150.         try changeall "fi", "▐",  range, case, wholeWord, useattributes
  151.     else
  152.      findtypeattr1   origFont, any, any, any, any, any 
  153.      changetypeattr1 ligFont,  any, any, any, any, any
  154.      try changeall "fi", "W",  range, case, wholeWord, useattributes
  155.     endif
  156. else
  157.     if platform = MACINTOSH
  158.         try changeall "▐", "fi", range, case, wholeWord, useattributes
  159.     else
  160.      findtypeattr1   ligFont, any, any, any, any, any 
  161.    changetypeattr1 origFont,  any, any, any, any, any
  162.      try changeall "W", "fi",  range, case, wholeWord, useattributes
  163.     endif
  164. endif
  165.  
  166.     
  167. if doflLig // *** fl **********************
  168.     if platform = MACINTOSH
  169.         try changeall "fl", "▀",  range, case, wholeWord, useattributes
  170.     else
  171.      findtypeattr1   origFont, any, any, any, any, any 
  172.      changetypeattr1 ligFont,  any, any, any, any, any
  173.         try changeall "fl", "X",  range, case, wholeWord, useattributes
  174.     endif
  175. else
  176.     if platform = MACINTOSH
  177.         try changeall "▀", "fl", range, case, wholeWord, useattributes
  178.     else
  179.      findtypeattr1   ligFont, any, any, any, any, any 
  180.      changetypeattr1 origFont,  any, any, any, any, any
  181.         try changeall "X", "fl", range, case, wholeWord, useattributes
  182.     endif
  183. endif
  184.  
  185. editlayout
  186.  
  187. return
  188.